package com.kingdee.eas.custom.mm.app;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import java.lang.String;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.bos.dao.IObjectCollection;



public abstract class AbstractImpFromSalePlanFacadeControllerBean extends AbstractBizControllerBean implements ImpFromSalePlanFacadeController
{
    protected AbstractImpFromSalePlanFacadeControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("985FECFD");
    }

    public void insertORupdate(Context ctx, IObjectCollection reqPlancollection, IObjectCollection salePlancollection) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("023447ff-5f6a-450e-af96-5f1071c06ee8"), new Object[]{ctx, reqPlancollection, salePlancollection});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _insertORupdate(ctx, reqPlancollection, salePlancollection);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _insertORupdate(Context ctx, IObjectCollection reqPlancollection, IObjectCollection salePlancollection) throws BOSException, EASBizException;

    public void updateSalePlanCusFlag(Context ctx, IObjectCollection sellPlancollection) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("12a89383-abf7-4988-92d7-023c66ff9591"), new Object[]{ctx, sellPlancollection});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _updateSalePlanCusFlag(ctx, sellPlancollection);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _updateSalePlanCusFlag(Context ctx, IObjectCollection sellPlancollection) throws BOSException, EASBizException;

    public int updateMoney(Context ctx, String sql) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("e9286d79-d37a-4433-9c3e-6e1d1b595b6d"), new Object[]{ctx, sql});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            int retValue = (int)_updateMoney(ctx, sql);
            svcCtx.setMethodReturnValue(new Integer(retValue));
            }
            invokeServiceAfter(svcCtx);
            return ((Integer)svcCtx.getMethodReturnValue()).intValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected int _updateMoney(Context ctx, String sql) throws BOSException
    {    	
        return 0;
    }

}